namespace WinChrome.Convertors
{
    using System;
    using System.Globalization;
    using System.Windows;
    using System.Windows.Data;

    /// <summary>Visible if you can maximize converter.</summary>
    public class WindowStateCanMaximizeConverter : IValueConverter
    {
        public WindowStateCanMaximizeConverter()
        {
            TrueValue = Visibility.Visible;
            FalseValue = Visibility.Hidden;
        }

        public object TrueValue { get; set; }
        public object FalseValue { get; set; }
        /// <summary>The convert.</summary>
        /// <param name="value">The value.</param>
        /// <param name="targetType">The target type.</param>
        /// <param name="parameter">The parameter.</param>
        /// <param name="culture">The culture.</param>
        /// <returns>The <see cref="object"/>.</returns>
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
		{
            if ((WindowState)value == WindowState.Maximized)
                return TrueValue;
            else
                return FalseValue;
		}

        /// <summary>The convert back.</summary>
        /// <param name="value">The value.</param>
        /// <param name="targetType">The target type.</param>
        /// <param name="parameter">The parameter.</param>
        /// <param name="culture">The culture.</param>
        /// <returns>The <see cref="object"/>.</returns>
        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
		{
            throw new NotSupportedException();
		}
	}
}